//
//  MeatMineViewController.m
//  PigMarket
//
//  Created by 张敬 on 2019/7/30.
//  Copyright © 2019年 pigmarket.oc. All rights reserved.
//

#import "MeatMineViewController.h"
#import "MeatMineTableViewCell.h"

#import "MeatMineHeader.h"
#import "MeatMineFooter.h"


@interface MeatMineViewController ()

@property (nonatomic, strong) MeatMineHeader *header;

@property (nonatomic, strong) MeatMineFooter *footer;

@end

@implementation MeatMineViewController

#pragma mark - lifecycle methods

- (void)setupUI{
    
    //    self.currentIndex = 0;
    //    [self.view addSubview:self.footer];
    //
    //    CGFloat h = KScreenHeight - (TJ_MeatShop_Header + _footer.height + 42);
    //    self.tableView.height = h;
    //    self.footer.mj_y = self.tableView.bottom;
}

#pragma mark - networking methods
#pragma mark - response methods
#pragma mark - public methods

#pragma mark - tableview delegate/dataSource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 3;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 123;
}



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    MeatMineTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MeatMineTableViewCell"];
    
    if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
        [cell setSeparatorInset:UIEdgeInsetsMake(0, 0, 0, 0)];
    }
    
    return cell;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
}

#pragma mark - setter and getter


#pragma mark - override methods

- (void)registerTableViewCell{
    
    
    CGFloat kTableViewHeight = KScreenHeight - 192 - TJ_TabBarHeight;
    self.tableView.height = kTableViewHeight;
    self.tableView.separatorColor = mIconLineColor;
    self.tableView.tableHeaderView = self.header;
    self.tableView.tableFooterView = self.footer;

    [self.tableView registerClass:[MeatMineTableViewCell class] forCellReuseIdentifier:@"MeatMineTableViewCell"];

}


- (MeatMineHeader *)header{
    
    if (!_header) {
        _header = [[MeatMineHeader alloc] init];
    }
    return _header;
}

- (MeatMineFooter *)footer{
    
    if (!_footer) {
        _footer = [[MeatMineFooter alloc] init];
    }
    return _footer;
}



@end
